package com.tengfei.blogsystem.response;

/**
 * @version v1.0
 * @author} feige
 * @date 2021-10-14-16:45
 * @description
 */
public class ResponseResult {
    // 是否成功
    private boolean success;
    // 状态码
    private int code;
    // 提示消息
    private String message;
    // 返回内容对象
    private Object data;

    public ResponseResult() {
    }

    public ResponseResult(ResponseState responseState) {
        this.success = responseState.isSuccess();
        this.code = responseState.getCode();
        this.message = responseState.getMessage();
    }

    public ResponseResult(ResponseState responseState, String message) {
        this.success = responseState.isSuccess();
        this.code = responseState.getCode();
        this.message = message;
    }

    public ResponseResult(ResponseState responseState, Object data) {
        this.success = responseState.isSuccess();
        this.code = responseState.getCode();
        this.message = responseState.getMessage();
        this.data = data;
    }

    public ResponseResult(ResponseState responseState, String message, Object data) {
        this.success = responseState.isSuccess();
        this.code = responseState.getCode();
        this.message = message;
        this.data = data;
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
